import formBuilder from "@/comps/form/formBuilder";
import api from "./api";
/*
fb.addText("item","物品",3)
fb.addText("itemName","物品名",3)
fb.addText("type","入库类型",3)
fb.addText("typeName","类型名称",3)
fb.addText("ioType","出入库类型",3)
fb.addText("ymd","年月日",3)
fb.addText("y","年",3)
fb.addText("m","月",3)
fb.addText("d","日",3)
fb.addText("num","数量",3)
fb.addText("cost","价值",3)

* */
export default {
    main:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addText("name").setSpan(3).setLabel("姓名")

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()

        return fb
    },
    tree:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100)

        fb.addCascade("parentId").setLabel("上级分类").setSpan(3)
            .setApi(api.urlTree)

        fb.addText("name").setSpan(6).setLabel("分类名称")
            .setRules([fb.R.notNull("名称不能为空")])

        fb.addText("sort").setSpan(3).setLabel("排序").setTypeNumber()
        return fb
    },
    other:function () {
        let fb = formBuilder()
        fb.setLabelWidth(100).setLabelPosition("right")

        return fb
    }
}